import request from '@/common/request'

// 供应商周统计
export function supplierWeekSupportSta (params) {
    return request({
        url: '/supplier/weekSupportSta',
        method: 'get',
        params: params
    })
}
// 供应商周统计
export function supplierMonthSupportSta (params) {
    return request({
        url: '/supplier/monthSupportSta',
        method: 'get',
        params: params
    })
}
// 供应商周统计
export function supplierYaerSupportSta (params) {
    return request({
        url: '/supplier/yearSupportSta',
        method: 'get',
        params: params
    })
}
// 供应商周统计
export function supplierDateList (params) {
    return request({
        url: '/supplier/dateList',
        method: 'get',
        params: params
    })
}
// 供应商当日统计
export function supplierTodaySta () {
    return request({
        url: '/supplier/todaySta',
        method: 'get'
    })
}
// 供应商当日统计
export function supplierTodayList () {
    return request({
        url: '/supplier/todayList',
        method: 'get'
    })
}

// 原材料
// 我的原材料列表
export function myMaterialListApi () {
    return request({
        url: '/supplier-material-management/myList',
        method: 'get'
    })
}
// 修改时获取原材料信息
export function getMaterialByIdApi (materialId) {
    return request({
        url: `/supplier-material-management/getById/${materialId}`,
        method: 'get'
    })
}
// 更新原材料
export function updateMaterialApplyApi (data) {
    return request({
        url: '/materialApply/add',
        method: 'post',
        data: data
    })
}

// 待审核列表
export function getMaterialApplyListApi (params) {
    return request({
        url: '/materialApply/listApply ',
        method: 'get',
        params: params
    })
}

// 审核记录
export function getOneMaterialApplyRecordsApi (materialId) {
    return request({
        url: `/materialApply/listByMaterialId/${materialId}`,
        method: 'get'
    })
}

// 撤销申请
export function cancelMaterialApplyApi (applyId) {
    return request({
        url: `/materialApply/cancel/${applyId}`,
        method: 'put'
    })
}
